<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:util="http://java.sun.com/jsf/composite/util">
	
	<!-- Dialogo Novo Dado -->
	<p:dialog appendToBody="true" closable="true" header="#{i18n.Dado_DialogoNovo_Header}"
		modal="false" widgetVar="dialogoNovoDado" width="540" resizable="false">
		<h:form id="formNovoDado">
			<div class="dialogo_container_18">
				<div class="dialogo_grid_18">
					<p:messages closable="true" id="messageNovoDado" />
				</div>
				<util:dialogoLabel value="#{i18n.Dado_Nome}" />
				<div class="dialogo_grid_18">
					<p:inputText value="#{deBean.dadoInstance.nomeTela}" styleClass="dialogo_width_18" 
						required="true" requiredMessage="#{i18n.Dado_Required_Nome}" maxlength="128" />
				</div>
				<util:dialogoLabel value="#{i18n.Dado_AtributoClasse}" />
				<div class="dialogo_grid_18">
					<p:inputText value="#{deBean.dadoInstance.atributoClasse}" styleClass="dialogo_width_18" 
						required="true" requiredMessage="#{i18n.Dado_Required_AtributoClasse}" maxlength="128" />
				</div>
				<util:dialogoLabel value="#{i18n.Dado_RegraDescricao}" />
				<div class="dialogo_grid_18">
					<p:inputTextarea value="#{deBean.dadoInstance.regraDescricao}" styleClass="dialogo_width_18" 
						required="true" requiredMessage="#{i18n.Dado_Required_AtributoClasse}" maxlength="255" />
				</div>
				<util:dialogoLabel grid="9" value="#{i18n.Dado_TipoDado}" />
				<util:dialogoLabel grid="9" value="#{i18n.Dado_Tamanho}" />
				<div class="dialogo_grid_9">
					<p:inputText value="#{deBean.dadoInstance.tipoDado}" styleClass="dialogo_width_8" 
						required="true" requiredMessage="#{i18n.Dado_Required_TipoDado}" maxlength="32" />
				</div>
				<div class="dialogo_grid_9">
					<p:inputText value="#{deBean.dadoInstance.tamanho}" styleClass="dialogo_width_9" 
						required="true" requiredMessage="#{i18n.Dado_Required_Tamanho}" />
				</div>
				<util:dialogoLabel grid="9" value="#{i18n.Dado_Editavel}" />
				<util:dialogoLabel grid="9" value="#{i18n.Dado_Obrrigatório}" />
				<div class="dialogo_grid_9">
					<p:selectOneRadio value="#{deBean.dadoInstance.editavel}" styleClass="dialogo_width_8" 
						required="true" requiredMessage="#{i18n.Dado_Required_Editavel}">
						<f:selectItem itemValue="#{true}" itemLabel="#{i18n.Sim}" />
						<f:selectItem itemValue="#{false}" itemLabel="#{i18n.Nao}" />
					</p:selectOneRadio>
				</div>
				<div class="dialogo_grid_9">
					<p:selectOneRadio value="#{deBean.dadoInstance.editavel}" styleClass="dialogo_width_9" 
						required="true" requiredMessage="#{i18n.Dado_Required_Obrigatorio}">
						<f:selectItem itemValue="#{true}" itemLabel="#{i18n.Sim}" />
						<f:selectItem itemValue="#{false}" itemLabel="#{i18n.Nao}" />
					</p:selectOneRadio>
				</div>
				<util:hr />
				<div class="dialogo_grid_18">
					<p:commandButton onclick="dialogoNovoDado.hide()" type="button" 
						value="#{i18n.btn_Desistir}" style="float:right"/>
					<p:commandButton action="#{deBean.salvarDado}" update="@form, :formPrincipal" 
						value="#{i18n.btn_Salvar}" style="float:right" 
						onstart="spinner.show();" oncomplete="onCompleteNovoDado();"/>
				</div>
			</div>	
		</h:form>
	</p:dialog>
	
	<p:dialog style="position:absolute" header="#{i18n.DialogoExcluirDado_Header}" widgetVar="dialogoExcluirDado" 
		width="450" modal="true" appendToBody="true" closable="true" resizable="false" >
		<h:form id="formExcluirDado">  
			<div class="dialog_container_16">
				<div class="dialog_grid_16 div-label" style="margin-top: 7px; margin-bottom: 7px;">
					<center><label class="label">#{deBean.msgExclusao}</label></center>
				</div>
				<div class="dialog_grid_16"><hr /></div>
				<div class="dialog_grid_16 right">
					<p:commandButton value="#{i18n.btn_Confirmar}" update=":formPrincipal"
						onstart="spinner.show();" oncomplete="spinner.hide();dialogoExcluirDado.hide();" 
						action="#{deBean.excluirDado}" />
					<p:commandButton value="#{i18n.btn_Cancelar}" type="button" onclick="dialogoExcluirDado.hide();" />
				</div>
			</div>
		</h:form>
	</p:dialog>
	
</f:view>